/** 
 * Created on 2008-9-26 下午01:53:48 by Administrator
 *
 * Copyright (c) 2007 GBCom Communication Technology CO.,Ltd
 * All rights reserved.
 */
package com.gbcom.autocompile.mail;

import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;

/**
 * 
 * @author Administrator
 * @version 2.0
 */
public class SmtpAuthentic extends Authenticator {

	/** Creates a new instance of Authentic */
	public SmtpAuthentic() {

	}

	/**
	 * 
	 * TODO description here
	 * 
	 * @param name
	 *            name
	 * @param password
	 *            password
	 */
	public SmtpAuthentic(String name, String password) {
		this.setUsername(name);
		this.setPwd(password);
	}

	// username为发送邮箱@前面的部分

	private String username = "";

	// pwd为发送邮箱的密码
	private String pwd = "";

	@Override
	protected PasswordAuthentication getPasswordAuthentication() {
		return new PasswordAuthentication(getUsername(), getPwd());
	}

	/**
	 * 
	 * TODO description here
	 * 
	 * @return username
	 */
	public String getUsername() {
		return username;
	}

	/**
	 * 
	 * TODO description here
	 * 
	 * @param username
	 *            username
	 */
	public void setUsername(String username) {
		this.username = username;
	}

	/**
	 * 
	 * TODO description here
	 * 
	 * @return pwd
	 */
	public String getPwd() {
		return pwd;
	}

	/**
	 * 
	 * TODO description here
	 * 
	 * @param pwd
	 *            pwd
	 */
	public void setPwd(String pwd) {
		this.pwd = pwd;
	}

}
